import Vue from 'vue'
import VueRouter from 'vue-router'
// 首页
import home from '@/view/home/home' 

Vue.use(VueRouter)

export default new VueRouter({
  routes: [{
      path: '/',
      component: home
    },{
      path:'/city',
      component:()=>import('@/view/city/city')
    },{
      path:'/detail',
      component: ()=>import('@/view/detail/detail')
    },{
      path:"/detailList",
      component: ()=>import('@/view/detailList/detailList')
    }],
    // 解决路由返回之后页面位置问题 始终回到最顶部
    scrollBehavior (to, from, savedPosition) {
      return { x: 0, y: 0 }
    }
})
